package com.zhuiyun.project.api.video.videoReview.controller;

import com.zhuiyun.project.annotation.OptLog;
import com.zhuiyun.project.api.video.videoReview.model.VideoReviewModel;
import com.zhuiyun.project.api.video.videoReview.service.VideoReviewService;
import com.zhuiyun.project.common.controller.BaseController;
import com.zhuiyun.project.common.errorCode.CommonException;
import com.zhuiyun.project.common.response.CommonResult;
import com.zhuiyun.project.utils.constants.CommonConstants;
import com.zhuiyun.project.utils.pageUtil.PageRequest;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName VideoReviewController
 * @Description TODO
 * @Author Administrator
 * @Date 2023/12/26 10:34
 **/
@RestController
@RequestMapping("/VideoReview")
@Slf4j
public class VideoReviewController extends BaseController {

    @Autowired
    private VideoReviewService videoReviewService;

    /**
    * @Author qsh
    * @Description 未审核视频列表
    * @Date 2024/2/29 15:37
    * @Return com.zhuiyun.project.common.response.CommonResult
    * @param videoReviewModel
* @param pageRequest
    */
    @GetMapping("/videoReviewList")
    @ApiOperation(value = "分页查询未审核视频接口")
    @OptLog(modular = "视频审核管理", type = CommonConstants.SELECT, describe = "分页查询未审核视频")
    public CommonResult videoReviewList(VideoReviewModel videoReviewModel, PageRequest pageRequest){
        return videoReviewService.videoReviewList(videoReviewModel,pageRequest);
    }

    /**
    * @Author qsh
    * @Description 审核通过视频列表
    * @Date 2024/2/29 15:37
    * @Return com.zhuiyun.project.common.response.CommonResult
    * @param videoReviewModel
* @param pageRequest
    */
    @GetMapping("/videoReviewListT")
    @ApiOperation(value = "分页查询未审核视频接口")
    @OptLog(modular = "视频审核管理", type = CommonConstants.SELECT, describe = "分页查询未审核视频")
    public CommonResult videoReviewListT(VideoReviewModel videoReviewModel, PageRequest pageRequest){
        return videoReviewService.videoReviewListT(videoReviewModel,pageRequest);
    }

    /**
    * @Author qsh
    * @Description 审核拒绝视频列表
    * @Date 2024/2/29 15:38
    * @Return com.zhuiyun.project.common.response.CommonResult
    * @param videoReviewModel
* @param pageRequest
    */
    @GetMapping("/videoReviewListW")
    @ApiOperation(value = "分页查询未审核视频接口")
    @OptLog(modular = "视频审核管理", type = CommonConstants.SELECT, describe = "分页查询未审核视频")
    public CommonResult videoReviewListW(VideoReviewModel videoReviewModel, PageRequest pageRequest){
        return videoReviewService.videoReviewListW(videoReviewModel,pageRequest);
    }

    /**
     * @Author qsh
     * @Description 审核视频
     * @Date 2023/12/15 15:30
     * @Return com.zhuiyun.project.common.response.CommonResult
     * @param videoIds
     */
    @PutMapping("/shVideoById/{videoIds}")
    @ApiOperation(value = "审核视频接口")
    @OptLog(modular = "视频管理", type = CommonConstants.DELETE, describe = "审核视频")
    public CommonResult ReviewVideo(@RequestBody Integer[] reviewIds,@PathVariable("videoIds") List<Integer> videoIds ) throws CommonException {
        log.info("审核视频");
        return videoReviewService.ReviewVideo(reviewIds,videoIds);
    }
}
